﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<ProjectDirector.ViewModels.CustomerViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Create New Client
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>

<table width="100%" 
        style="border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: #C0C0C0"><tr><td style="width:55px;"><img src="../../Content/Images/bigimgs/158.png" width="50px" height="50px" alt="" /></td>
<td><span style="font-size:14px; font-weight:bold;">Create New Customer Account</span>
<div style="float:right;">
    <%: Html.ActionLink("Back to List", "Index") %>
</div>

</td></tr>
</table> 

<% Html.BeginForm();%>
    <%: Html.ValidationSummary(true) %> 
        <table width="100%" 
        style="border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: #C0C0C0; table-layout:fixed">
        <tr><td style="width: 132px"><%: Html.LabelFor(m=>m.Customer.CompanyName)%></td>
        <td><%:Html.TextBoxFor(m=>m.Customer.CompanyName, new{@class="BigTextBox"}) %></td>
            <td style="width: 66px"></td>
            <td style="font-weight: 700; text-decoration: underline; width: 170px;">Address </td><td></td></tr>
        <tr><td style="width: 132px"><%:Html.LabelFor(m=>m.Customer.BusinessTypeId) %></td>
        <td><%:Html.DropDownListFor(m=>m.Customer.BusinessTypeId, new SelectList(Model.BusinessTypes, "BusinessTypeId","BusinessTypeName"),new{@class="TextBox"}) %></td>
            <td style="width: 66px"></td>
        <td style="width: 170px"><%:Html.LabelFor(m=>m.Address.Address1) %></td><td><%:Html.TextBoxFor(m=>m.Address.Address1,new{@class="TextBox"}) %></td></tr>
        <tr><td style="width: 132px"><%:Html.LabelFor(m=>m.Customer.Telephone) %></td>
        <td><%:Html.TextBoxFor(m=>m.Customer.Telephone, new{@class="TextBox"}) %></td>
            <td style="width: 66px"></td>
        <td style="width: 170px"><%:Html.LabelFor(m=>m.Address.Address2)%></td><td><%:Html.TextBoxFor(m=>m.Address.Address2,new{@class="TextBox"}) %></td></tr>
        <tr><td style="width: 132px"><%:Html.LabelFor(m=>m.Customer.Email) %></td>
        <td><%:Html.TextBoxFor(m=>m.Customer.Email,new{@class="BigTextBox"}) %></td>
            <td style="width: 66px"></td>
        <td style="width: 170px"><%:Html.LabelFor(m=>m.Address.Town) %></td><td><%:Html.TextBoxFor(m=>m.Address.Town,new{@class="TextBox"}) %></td></tr>
        <tr><td style="width: 132px"><%:Html.LabelFor(m=>m.Customer.FaxNumber) %></td>
        <td><%:Html.TextBoxFor(m=>m.Customer.FaxNumber,new{@class="TextBox"}) %></td>
            <td style="width: 66px"></td>
        <td style="width: 170px"><%:Html.LabelFor(m=>m.Address.PostalCode) %></td><td><%:Html.TextBoxFor(m=>m.Address.PostalCode,new{@class="SmallTextBox"}) %></td></tr>
        <tr><td style="width: 132px"><%:Html.LabelFor(m=>m.Customer.WebSite) %></td>
        <td><%:Html.TextBoxFor(m=>m.Customer.WebSite,new{@class="BigTextBox"}) %></td>
            <td style="width: 66px"></td>
        <td style="width: 170px"><%:Html.LabelFor(m=>m.Address.CountryId) %></td><td><%:Html.DropDownListFor(m=>m.Address.CountryId, new SelectList(Model.Countries,"CountryId","CountryName"),new{@class="TextBox"}) %></td></tr>        
        </table>        
        <input type="submit" value="Create Customer" class="Button" />           
<% Html.EndForm();%>
<br />
   <% if (!string.IsNullOrEmpty(Model.Result)) {%>
   <span style="font-size:12px; color:Blue;"><%: Model.Result %></span>
   <%} %>
 </asp:Content>
